home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / UTIL / SYS / RECURSIVE / _files / _recursive / recursive < prev    next >
Text File  |  1991-04-07  |  1KB  |  51 lines

  1. BEGIN {
  2.       char x[ 128 ];
  3.       fnx="";
  4.       zaehler=0;
  5.       system("<rec$dir>.Pathname { > <rec$dir>.output2 }");
  6.       system("count * r~v~c { > <rec$dir>.output3 }");
  7.       }
  8.  
  9. /' /
  10.    {
  11.    if (fnx!=FILENAME)
  12.       {
  13.       y=1;
  14.       fnx=FILENAME
  15.       }
  16.    if (y==1)
  17.       {
  18.       x=$1;
  19.       y=0;
  20.       }
  21.    else
  22.       x=substr($1,2);
  23.  
  24. # restore orginal directory and execute commando
  25.    if (FILENAME=="<rec$dir>.output2")
  26.       {
  27.       system("echo { > <rec$dir>.output }");
  28.       command=sprintf("%s { >> <rec$dir>.output }",var);
  29.       backcd=sprintf("dir %s",x);
  30.       }
  31.  
  32. # jump to directory, execute commando
  33.    if (FILENAME=="<rec$dir>.output3")
  34.       {
  35.       if (x=="Directory")
  36.          {
  37.          system(backcd);
  38.          cd=sprintf("dir %s",$2);
  39.          system(cd);
  40.          system(command);
  41.          }
  42.       }
  43.    }
  44.  
  45. END   {
  46.       system(backcd);
  47.       system(command);
  48.       system("delete <rec$dir>.output2");
  49.       system("delete <rec$dir>.output3");
  50.       system("type <rec$dir>.output");
  51.       }